package com.zhang.zhangapp.bean.user;

import android.os.Parcel;
import android.os.Parcelable;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by 罗肖 on 2017/6/30.
 */
@Table(name = "z_user1")
public class User implements Parcelable {
    public User() {
    }

    @Column(name = "id", isId = true)
    private int id;
    @Column(name = "age")
    private String age;
    @Column(name = "alipay")
    private String alipay;
    @Column(name = "balance")
    private String balance;
    @Column(name = "brithday")
    private String brithday;
    @Column(name = "ctime")
    private String ctime;
    @Column(name = "delflag")
    private String delflag;
    @Column(name = "integral")
    private String integral;
    @Column(name = "loginsec")
    private String loginsec;
    @Column(name = "memberId")
    private String memberId;
    @Column(name = "mobilenum")
    private String mobilenum;
    @Column(name = "mtime")
    private String mtime;
    @Column(name = "name")
    private String name;
    @Column(name = "nickname")
    private String nickname;
    @Column(name = "orders")
    private String orders;
    @Column(name = "paysec")
    private String paysec;
    @Column(name = "photo")
    private String photo;
    @Column(name = "qq")
    private String qq;
    @Column(name = "sex")
    private String sex;
    @Column(name = "status")
    private String status;
    @Column(name = "weixin")
    private String weixin;
    @Column(name = "zodiac")
    private String zodiac;
    @Column(name = "token")
    private String token;
    @Column(name = "tickets")
    private String tickets;

    protected User(Parcel in) {
        id = in.readInt();
        age = in.readString();
        alipay = in.readString();
        balance = in.readString();
        brithday = in.readString();
        ctime = in.readString();
        delflag = in.readString();
        integral = in.readString();
        loginsec = in.readString();
        memberId = in.readString();
        mobilenum = in.readString();
        mtime = in.readString();
        name = in.readString();
        nickname = in.readString();
        orders = in.readString();
        paysec = in.readString();
        photo = in.readString();
        qq = in.readString();
        sex = in.readString();
        status = in.readString();
        weixin = in.readString();
        zodiac = in.readString();
        token = in.readString();
        tickets = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(age);
        dest.writeString(alipay);
        dest.writeString(balance);
        dest.writeString(brithday);
        dest.writeString(ctime);
        dest.writeString(delflag);
        dest.writeString(integral);
        dest.writeString(loginsec);
        dest.writeString(memberId);
        dest.writeString(mobilenum);
        dest.writeString(mtime);
        dest.writeString(name);
        dest.writeString(nickname);
        dest.writeString(orders);
        dest.writeString(paysec);
        dest.writeString(photo);
        dest.writeString(qq);
        dest.writeString(sex);
        dest.writeString(status);
        dest.writeString(weixin);
        dest.writeString(zodiac);
        dest.writeString(token);
        dest.writeString(tickets);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<User> CREATOR = new Creator<User>() {
        @Override
        public User createFromParcel(Parcel in) {
            return new User(in);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getAlipay() {
        return alipay;
    }

    public void setAlipay(String alipay) {
        this.alipay = alipay;
    }

    public String getBalance() {
        return (balance == null || balance.equals("")) ? "0" : balance;
    }

    public BigDecimal getBigDecimalBalance() {
        return new BigDecimal(getBalance());
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getBrithday() {
        return brithday;
    }

    public void setBrithday(String brithday) {
        this.brithday = brithday;
    }

    public String getCtime() {
        return ctime;
    }

    public void setCtime(String ctime) {
        this.ctime = ctime;
    }

    public String getDelflag() {
        return delflag;
    }

    public void setDelflag(String delflag) {
        this.delflag = delflag;
    }

    public String getIntegral() {
        return integral;
    }

    public void setIntegral(String integral) {
        this.integral = integral;
    }

    public String getLoginsec() {
        return loginsec;
    }

    public void setLoginsec(String loginsec) {
        this.loginsec = loginsec;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getMobilenum() {
        return mobilenum;
    }

    public void setMobilenum(String mobilenum) {
        this.mobilenum = mobilenum;
    }

    public String getMtime() {
        return mtime;
    }

    public void setMtime(String mtime) {
        this.mtime = mtime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getOrders() {
        return orders;
    }

    public void setOrders(String orders) {
        this.orders = orders;
    }

    public String getPaysec() {
        return paysec;
    }

    public void setPaysec(String paysec) {
        this.paysec = paysec;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getWeixin() {
        return weixin;
    }

    public void setWeixin(String weixin) {
        this.weixin = weixin;
    }

    public String getZodiac() {
        return zodiac;
    }

    public void setZodiac(String zodiac) {
        this.zodiac = zodiac;
    }

    public String getTickets() {
        return tickets == null ? "0" : tickets;
    }

    public void setTickets(String tickets) {
        this.tickets = tickets;
    }
}
